package main

import (
	"fmt"
"io/ioutil"
	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()

	// Query string parameters are parsed using the existing underlying request object.
	// The request responds to an url matching:  /welcome?firstname=Jane&lastname=Doe

	router.POST("/test", func(c *gin.Context) {
		var bodyBytes []byte // 我们需要的body内容

	// 从原有Request.Body读取
	bodyBytes, err := ioutil.ReadAll(c.Request.Body)
			if err != nil {
			fmt.Errorf("dd",err)
		}


		fmt.Printf("---%+v\n", string(bodyBytes))
	})
	router.Run(":8080")
}
